window.onload = function() {
	document.getElementById("login").onclick = function() {
		var str_stuno = document.getElementById("stuno").value;
		var str_pass = document.getElementById("pass").value;

		var reg_stu = /^\d{12}$/;
		var reg_pass = /^[\w\W]{6,16}$/;

		var b_match_stu = reg_stu.test(str_stuno);
		var b_match_pass = reg_pass.test(str_pass);

		if(b_match_stu && b_match_pass) {
			document.getElementById("warn_stuno").style.display = "none";
			document.getElementById("warn_pass").style.display = "none";
			document.forms[0].submit();
		} else if (!b_match_stu && b_match_pass) {
			document.getElementById("warn_stuno").style.display = "inline-block";
			document.getElementById("warn_pass").style.display = "none";
		} else if (!b_match_pass && b_match_stu){
			document.getElementById("warn_stuno").style.display = "none";
			document.getElementById("warn_pass").style.display = "inline-block";
		} else {
			document.getElementById("warn_stuno").style.display = "inline-block";
			document.getElementById("warn_pass").style.display = "inline-block";
		}
	}
}
